Optimal. Leaf size=89 \[ x \left (a^2-b^2\right )+\frac {a b \tan ^2(c+d x)}{d}+\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan ^5(c+d x)}{5 d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3661, 1810, 635, 203, 260} \[ x \left (a^2-b^2\right )+\frac {a b \tan ^2(c+d x)}{d}+\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan ^5(c+d x)}{5 d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 1810
Rule 3661
Rubi steps
\begin {align*} \int \left (a+b \tan ^3(c+d x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+b x^3\right )^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (b^2+2 a b x-b^2 x^2+b^2 x^4+\frac {a^2-b^2-2 a b x}{1+x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {b^2 \tan (c+d x)}{d}+\frac {a b \tan ^2(c+d x)}{d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan ^5(c+d x)}{5 d}+\frac {\operatorname {Subst}\left (\int \frac {a^2-b^2-2 a b x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {b^2 \tan (c+d x)}{d}+\frac {a b \tan ^2(c+d x)}{d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan ^5(c+d x)}{5 d}-\frac {(2 a b) \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (a^2-b^2\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\left (a^2-b^2\right ) x+\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d}+\frac {a b \tan ^2(c+d x)}{d}-\frac {b^2 \tan ^3(c+d x)}{3 d}+\frac {b^2 \tan ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.52, size = 107, normalized size = 1.20 \[ \frac {30 a b \tan ^2(c+d x)-15 i \left ((a-i b)^2 \log (-\tan (c+d x)+i)-(a+i b)^2 \log (\tan (c+d x)+i)\right )+6 b^2 \tan ^5(c+d x)-10 b^2 \tan ^3(c+d x)+30 b^2 \tan (c+d x)}{30 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 85, normalized size = 0.96 \[ \frac {3 \, b^{2} \tan \left (d x + c\right )^{5} - 5 \, b^{2} \tan \left (d x + c\right )^{3} + 15 \, a b \tan \left (d x + c\right )^{2} + 15 \, {\left (a^{2} - b^{2}\right )} d x + 15 \, a b \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 15 \, b^{2} \tan \left (d x + c\right )}{15 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 14.42, size = 1065, normalized size = 11.97 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 108, normalized size = 1.21 \[ \frac {b^{2} \left (\tan ^{5}\left (d x +c \right )\right )}{5 d}-\frac {b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {a b \left (\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )}{d}-\frac {a b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {\arctan \left (\tan \left (d x +c \right )\right ) a^{2}}{d}-\frac {\arctan \left (\tan \left (d x +c \right )\right ) b^{2}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.92, size = 83, normalized size = 0.93 \[ a^{2} x + \frac {{\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} b^{2}}{15 \, d} - \frac {a b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.60, size = 117, normalized size = 1.31 \[ \frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}+\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5\,d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a+b\right )\,\left (a-b\right )}{a^2-b^2}\right )\,\left (a+b\right )\,\left (a-b\right )}{d}-\frac {a\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.60, size = 94, normalized size = 1.06 \[ \begin {cases} a^{2} x - \frac {a b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {a b \tan ^{2}{\left (c + d x \right )}}{d} - b^{2} x + \frac {b^{2} \tan ^{5}{\left (c + d x \right )}}{5 d} - \frac {b^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} + \frac {b^{2} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan ^{3}{\relax (c )}\right )^{2} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________